package com.whmnx.my.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.Nullable;

import com.google.android.material.tabs.TabLayout;
import com.whmnx.my.R;
import com.whmnx.my.databinding.FragmentJiaoyiBinding;
import com.whmnx.my.ui.viewmodel.JiaoYiModel;

import me.goldze.mvvmhabit.BR;
import me.goldze.mvvmhabit.base.BaseFragment;

/**
 * author : huang
 * date   : 2020/10/10 0010 18:04
 * version: 1.0
 * @author Administrator
 */
public class JiaoYiFragment extends BaseFragment<FragmentJiaoyiBinding, JiaoYiModel> {
    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_jiaoyi;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }


    @Override
    public void initData() {
        viewModel.initToolbar();
        binding.tabs.setupWithViewPager(binding.viewPager);
        binding.viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.tabs));
        viewModel.addPage();
    }
}
